local _base = {}
---@class Industry
---@field owner Role 产业主人
---@field administrators Role[] 产业管理员
---@field unit Obstacle 产业场景实例
---@field level integer 产业等级
---@field metadata table 元数据
_base.Industry = {}
_base.Industry.__index = _base.Industry
print(123)

---构造产业实例
---@param _role Role 产业管理员
---@return Industry
function _base.Industry:new(_role)
    local obj = {}
    obj.owner = _role
    obj.level = 1
    obj.administrators = { _role }
    return obj
end

---新增管理员
---@param _role Role
function _base.Industry:add_administrator(_role)
    table.insert(self.administrators, _role)
end

---移除管理员
---@param _role Role
function _base.Industry:remove_administrator(_role)
    for index, administrator in ipairs(self.administrators) do
        if administrator.get_roleid() == _role.get_roleid() then
            table.remove(self.administrators, index)
            break
        end
    end
end

---添加元数据
---@param metadata table
function _base.Industry:set_metadata(metadata)
    self.metadata = metadata
end

---添加根数据
---@param rootdata table
function _base.Industry:set_rootdata(rootdata)
    self.rootdata = rootdata
end

return _base.Industry